package com.hunny.facade;

import lombok.extern.slf4j.Slf4j;

/**
 * 电脑
 *
 * @author Create By Cb
 * @date 2022/05/13
 * @since 2022/5/13 15:31
 */
@Slf4j
public class Computer {

    /**
     * cpu
     */
    private static final Cpu CPU;
    /**
     * 磁盘
     */
    private static final Disk DISK;

    static {
        CPU = new Cpu();
        DISK = new Disk();
    }

    /**
     * 开放
     */
    public void open() {
        CPU.open();
        DISK.open();
        log.warn("Computer Open ....");
    }

    /**
     * 关闭
     */
    public void close() {
        CPU.close();
        DISK.close();
        log.warn("Computer Close ....");
    }
}